home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 1995 #5 & #6 / Amiga Plus CD - 1995 - No. 5 and 6.iso / pd / serien / purity / nr.42 / includes3v1 / includes3v1.lha / Intuition / GadgetClass.i < prev    next >
Text File  |  1994-12-04  |  11KB  |  316 lines

  1. { GadgetClass.i }
  2.  
  3. {$I   "Include:Exec/Types.i"}
  4. {$I   "Include:Intuition/Intuition.i"}
  5. {$I   "Include:Utility/TagItem.i"}
  6.  
  7.  
  8. {
  9.  * NOTE:  <intuition/iobsolete.h> is included at the END of this file!
  10.  }
  11.  
  12. { Gadget Class attributes      }
  13. CONST
  14.     GA_Dummy           =  (TAG_USER +$30000);
  15.     GA_Left            =  (GA_Dummy + $0001);
  16.     GA_RelRight        =  (GA_Dummy + $0002);
  17.     GA_Top             =  (GA_Dummy + $0003);
  18.     GA_RelBottom       =  (GA_Dummy + $0004);
  19.     GA_Width           =  (GA_Dummy + $0005);
  20.     GA_RelWidth        =  (GA_Dummy + $0006);
  21.     GA_Height          =  (GA_Dummy + $0007);
  22.     GA_RelHeight       =  (GA_Dummy + $0008);
  23.     GA_Text            =  (GA_Dummy + $0009); { ti_Data is (UBYTE *) }
  24.     GA_Image           =  (GA_Dummy + $000A);
  25.     GA_Border          =  (GA_Dummy + $000B);
  26.     GA_SelectRender    =  (GA_Dummy + $000C);
  27.     GA_Highlight       =  (GA_Dummy + $000D);
  28.     GA_Disabled        =  (GA_Dummy + $000E);
  29.     GA_GZZGadget       =  (GA_Dummy + $000F);
  30.     GA_ID              =  (GA_Dummy + $0010);
  31.     GA_UserData        =  (GA_Dummy + $0011);
  32.     GA_SpecialInfo     =  (GA_Dummy + $0012);
  33.     GA_Selected        =  (GA_Dummy + $0013);
  34.     GA_EndGadget       =  (GA_Dummy + $0014);
  35.     GA_Immediate       =  (GA_Dummy + $0015);
  36.     GA_RelVerify       =  (GA_Dummy + $0016);
  37.     GA_FollowMouse     =  (GA_Dummy + $0017);
  38.     GA_RightBorder     =  (GA_Dummy + $0018);
  39.     GA_LeftBorder      =  (GA_Dummy + $0019);
  40.     GA_TopBorder       =  (GA_Dummy + $001A);
  41.     GA_BottomBorder    =  (GA_Dummy + $001B);
  42.     GA_ToggleSelect    =  (GA_Dummy + $001C);
  43.  
  44.     { internal use only, until further notice, please }
  45.     GA_SysGadget       =  (GA_Dummy + $001D);
  46.         { bool, sets GTYP_SYSGADGET field in type      }
  47.     GA_SysGType        =  (GA_Dummy + $001E);
  48.         { e.g., GTYP_WUPFRONT, ...     }
  49.  
  50.     GA_Previous        =  (GA_Dummy + $001F);
  51.         { previous gadget (or (struct Gadget **)) in linked list
  52.          * NOTE: This attribute CANNOT be used to link new gadgets
  53.          * into the gadget list of an open window or requester.
  54.          * You must use AddGList().
  55.          }
  56.  
  57.     GA_Next            =  (GA_Dummy + $0020);
  58.          { not implemented }
  59.  
  60.     GA_DrawInfo        =  (GA_Dummy + $0021);
  61.         { some fancy gadgets need to see a DrawInfo
  62.          * when created or for layout
  63.          }
  64.  
  65. { You should use at most ONE of GA_Text, GA_IntuiText, and GA_LabelImage }
  66.  GA_IntuiText          =  (GA_Dummy + $0022);
  67.         { ti_Data is (struct IntuiText *) }
  68.  
  69.  GA_LabelImage         =  (GA_Dummy + $0023);
  70.         { ti_Data is an image (object), used in place of
  71.          * GadgetText
  72.          }
  73.  
  74.  GA_TabCycle           =  (GA_Dummy + $0024);
  75.         { New for V37:
  76.          * Boolean indicates that this gadget is to participate in
  77.          * cycling activation with Tab or Shift-Tab.
  78.          }
  79.  
  80.  GA_GadgetHelp         =  (GA_Dummy + $0025);
  81.         { New for V39:
  82.          * Boolean indicates that this gadget sends gadget-help
  83.          }
  84.  
  85.  GA_Bounds             =  (GA_Dummy + $0026);
  86.         { New for V39:
  87.          * ti_Data is a pointer to an IBox structure which is
  88.          * to be copied into the extended gadget's bounds.
  89.          }
  90.  
  91.  GA_RelSpecial         =  (GA_Dummy + $0027);
  92.         { New for V39:
  93.          * Boolean indicates that this gadget has the "special relativity"
  94.          * property, which is useful for certain fancy relativity
  95.          * operations through the GM_LAYOUT method.
  96.          }
  97.  
  98. { PROPGCLASS attributes }
  99.  
  100.  PGA_Dummy      = (TAG_USER + $31000);
  101.  PGA_Freedom    = (PGA_Dummy + $0001);
  102.         { only one of FREEVERT or FREEHORIZ }
  103.  PGA_Borderless = (PGA_Dummy + $0002);
  104.  PGA_HorizPot   = (PGA_Dummy + $0003);
  105.  PGA_HorizBody  = (PGA_Dummy + $0004);
  106.  PGA_VertPot    = (PGA_Dummy + $0005);
  107.  PGA_VertBody   = (PGA_Dummy + $0006);
  108.  PGA_Total      = (PGA_Dummy + $0007);
  109.  PGA_Visible    = (PGA_Dummy + $0008);
  110.  PGA_Top        = (PGA_Dummy + $0009);
  111. { New for V37: }
  112.  PGA_NewLook    = (PGA_Dummy + $000A);
  113.  
  114. { STRGCLASS attributes }
  115.  
  116.  STRINGA_Dummy         =  (TAG_USER      +$32000);
  117.  STRINGA_MaxChars      =  (STRINGA_Dummy + $0001);
  118.  STRINGA_Buffer        =  (STRINGA_Dummy + $0002);
  119.  STRINGA_UndoBuffer    =  (STRINGA_Dummy + $0003);
  120.  STRINGA_WorkBuffer    =  (STRINGA_Dummy + $0004);
  121.  STRINGA_BufferPos     =  (STRINGA_Dummy + $0005);
  122.  STRINGA_DispPos       =  (STRINGA_Dummy + $0006);
  123.  STRINGA_AltKeyMap     =  (STRINGA_Dummy + $0007);
  124.  STRINGA_Font          =  (STRINGA_Dummy + $0008);
  125.  STRINGA_Pens          =  (STRINGA_Dummy + $0009);
  126.  STRINGA_ActivePens    =  (STRINGA_Dummy + $000A);
  127.  STRINGA_EditHook      =  (STRINGA_Dummy + $000B);
  128.  STRINGA_EditModes     =  (STRINGA_Dummy + $000C);
  129.  
  130. { booleans }
  131.  STRINGA_ReplaceMode    = (STRINGA_Dummy + $000D);
  132.  STRINGA_FixedFieldMode = (STRINGA_Dummy + $000E);
  133.  STRINGA_NoFilterMode   = (STRINGA_Dummy + $000F);
  134.  
  135.  STRINGA_Justification  = (STRINGA_Dummy + $0010);
  136.         { GACT_STRINGCENTER, GACT_STRINGLEFT, GACT_STRINGRIGHT }
  137.  STRINGA_LongVal        = (STRINGA_Dummy + $0011);
  138.  STRINGA_TextVal        = (STRINGA_Dummy + $0012);
  139.  
  140.  STRINGA_ExitHelp       = (STRINGA_Dummy + $0013);
  141.         { STRINGA_ExitHelp is new for V37, and ignored by V36.
  142.          * Set this if you want the gadget to exit when Help is
  143.          * pressed.  Look for a code of $5F, the rawkey code for Help
  144.          }
  145.  
  146.  SG_DEFAULTMAXCHARS     = (128);
  147.  
  148. { Gadget Layout related attributes     }
  149.  
  150.  LAYOUTA_Dummy          = (TAG_USER  + $38000);
  151.  LAYOUTA_LayoutObj      = (LAYOUTA_Dummy + $0001);
  152.  LAYOUTA_Spacing        = (LAYOUTA_Dummy + $0002);
  153.  LAYOUTA_Orientation    = (LAYOUTA_Dummy + $0003);
  154.  
  155. { orientation values   }
  156.  LORIENT_NONE   = 0;
  157.  LORIENT_HORIZ  = 1;
  158.  LORIENT_VERT   = 2;
  159.  
  160.  
  161. { Gadget Method ID's   }
  162.  
  163.  GM_Dummy      =  (-1);    { not used for anything                }
  164.  GM_HITTEST    =  (0);     { return GMR_GADGETHIT IF you are clicked on
  165.                                  * (whether or not you are disabled).
  166.                                  }
  167.  GM_RENDER      = (1);     { draw yourself, in the appropriate state }
  168.  GM_GOACTIVE    = (2);     { you are now going to be fed input    }
  169.  GM_HANDLEINPUT = (3);     { handle that input                    }
  170.  GM_GOINACTIVE  = (4);     { whether or not by choice, you are done  }
  171.  GM_HELPTEST    = (5);     { Will you send gadget help if the mouse is
  172.                                  * at the specified coordinates?  See below
  173.                                  * for possible GMR_ values.
  174.                                  }
  175.  GM_LAYOUT      = (6);     { re-evaluate your size based on the GadgetInfo
  176.                                  * Domain.  Do NOT re-render yourself yet, you
  177.                                  * will be called when it is time...
  178.                                  }
  179.  
  180. { Parameter "Messages" passed to gadget class methods  }
  181.  
  182. { GM_HITTEST   }
  183. type
  184.   gpht_Mouse_Struct = Record
  185.    x,y : Short;
  186.   END;
  187.  
  188.   gpHitTest = Record
  189.     MethodID  : Integer;
  190.     gpht_GInfo : GadgetInfoPtr;
  191.     gpht_Mouse : gpht_Mouse_Struct;
  192.   END;
  193.   gpHitTestPtr =  ^gpHitTest;
  194.  
  195. const
  196. { For GM_HITTEST, return GMR_GADGETHIT if you were indeed hit,
  197.  * otherwise return zero.
  198.  *
  199.  * For GM_HELPTEST, return GMR_NOHELPHIT (zero) if you were not hit.
  200.  * Typically, return GMR_HELPHIT if you were hit.
  201.  * It is possible to pass a UWORD to the application via the Code field
  202.  * of the IDCMP_GADGETHELP message.  Return GMR_HELPCODE or'd with
  203.  * the UWORD-sized result you wish to return.
  204.  *
  205.  * GMR_HELPHIT yields a Code value of ((UWORD) ~0), which should
  206.  * mean "nothing particular" to the application.
  207.  }
  208.  
  209.  GMR_GADGETHIT  = ($00000004);    { GM_HITTEST hit }
  210.  
  211.  GMR_NOHELPHIT  = ($00000000);    { GM_HELPTEST didn't hit }
  212.  GMR_HELPHIT    = ($FFFFFFFF);    { GM_HELPTEST hit, return code = ~0 }
  213.  GMR_HELPCODE   = ($00010000);    { GM_HELPTEST hit, return low word as code }
  214.  
  215.  
  216. { GM_RENDER    }
  217. Type
  218.    gpRender = Record
  219.     MethodID  : Integer;
  220.     gpr_GInfo : GadgetInfoPtr;      { gadget context               }
  221.     gpr_RPort : RastPortPtr;        { all ready for use            }
  222.     gpr_Redraw : Integer;           { might be a "highlight pass"  }
  223.    END;
  224.    gpRenderPtr = ^gpRender;
  225.  
  226. { values of gpr_Redraw }
  227. CONST
  228.  GREDRAW_UPDATE = (2);     { incremental update, e.g. prop slider }
  229.  GREDRAW_REDRAW = (1);     { redraw gadget        }
  230.  GREDRAW_TOGGLE = (0);     { toggle highlight, IF applicable      }
  231.  
  232. { GM_GOACTIVE, GM_HANDLEINPUT  }
  233. Type
  234.   gpi_Mouse_Struct = Record
  235.    x,y : Short;
  236.   END;
  237.  
  238.   gpInput = Record
  239.     MethodID : Integer;
  240.     gpi_GInfo : GadgetInfoPtr;
  241.     gpi_IEvent : InputEventPtr;
  242.     gpi_Termination : Address;
  243.     gpi_Mouse : gpi_Mouse_Struct;
  244.     {* (V39) Pointer to TabletData structure, if this event originated
  245.      * from a tablet which sends IESUBCLASS_NEWTABLET events, or NULL if
  246.      * not.
  247.      *
  248.      * DO NOT ATTEMPT TO READ THIS FIELD UNDER INTUITION PRIOR TO V39!
  249.      * IT WILL BE INVALID!
  250.      *}
  251.    gpi_TabletData  : TabletDataPtr;
  252.   END;
  253.   gpInputPtr = ^gpInput;
  254.  
  255. { GM_HANDLEINPUT and GM_GOACTIVE  return code flags    }
  256. { return GMR_MEACTIVE (0) alone if you want more input.
  257.  * Otherwise, return ONE of GMR_NOREUSE and GMR_REUSE, and optionally
  258.  * GMR_VERIFY.
  259.  }
  260. CONST
  261.  GMR_MEACTIVE  =  (0);
  262.  GMR_NOREUSE   =  (2);
  263.  GMR_REUSE     =  (4);
  264.  GMR_VERIFY    =  (8);        { you MUST set cgp_Termination }
  265.  
  266. { New for V37:
  267.  * You can end activation with one of GMR_NEXTACTIVE and GMR_PREVACTIVE,
  268.  * which instructs Intuition to activate the next or previous gadget
  269.  * that has GFLG_TABCYCLE set.
  270.  }
  271.  GMR_NEXTACTIVE = (16);
  272.  GMR_PREVACTIVE = (32);
  273.  
  274. { GM_GOINACTIVE }
  275. Type
  276.    gpGoInactive = Record
  277.     MethodID    : Integer;
  278.     gpgi_GInfo  : GadgetInfoPtr;
  279.  
  280.     { V37 field only!  DO NOT attempt to read under V36! }
  281.     gpgi_Abort  : Integer;               { gpgi_Abort=1 IF gadget was aborted
  282.                                          * by Intuition and 0 if gadget went
  283.                                          * inactive at its own request
  284.                                          }
  285.    END;
  286.    gpGoInactivePtr = ^gpGoInactive;
  287.  
  288. {* New for V39: Intuition sends GM_LAYOUT to any GREL_ gadget when
  289.  * the gadget is added to the window (or when the window opens, if
  290.  * the gadget was part of the NewWindow.FirstGadget or the WA_Gadgets
  291.  * list), or when the window is resized.  Your gadget can set the
  292.  * GA_RelSpecial property to get GM_LAYOUT events without Intuition
  293.  * changing the interpretation of your gadget select box.  This
  294.  * allows for completely arbitrary resizing/repositioning based on
  295.  * window size.
  296.  *}
  297. {* GM_LAYOUT *}
  298. Type
  299.  gpLayout = Record
  300.     MethodID            : Integer;
  301.     gpl_GInfo           : GadgetInfoPtr;
  302.     gpl_Initial         : Integer;      {* non-zero if this method was invoked
  303.                                          * during AddGList() or OpenWindow()
  304.                                          * time.  zero if this method was invoked
  305.                                          * during window resizing.
  306.                                          *}
  307.  end;
  308.  gpLayoutPtr = ^gpLayout;
  309.  
  310.  
  311. {$I   "Include:intuition/iobsolete.i"};
  312.  
  313.  
  314.  
  315.  
  316.